﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Haha.Mvc
{
    public class HahaMap
    {
        public static HahaMap New
        {
            get
            {
                return new HahaMap();
            }
        }
        private Dictionary<object, object> dic = new Dictionary<object, object>();
        internal Dictionary<object, object> Dic
        {
            get
            {
                return dic;
            }
        }
        public object this[object k]
        {
            get
            {
                return dic[k];
            }
        }
        public HahaMap SetV(object k, object v)
        {
            dic.Add(k, v);
            return this;
        }

        public string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(dic);
            //return Json.JsonParser.Serialize<Dictionary<object, object>>(dic);
        }
    }
}
